﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UwinEducation.Application.Dtos;
using UwinEducation.Domain.Entities;


namespace UwinEducation.Application.Mappings
{
    public class RoleProfile : Profile
    {
        public RoleProfile()
        {
            CreateMap<Role, RoleDto>()
                .ForMember(dest => dest.CreatedTime, opt => opt.MapFrom(src => src.CreatedAt));

            //CreateMap<RolePermission, RolePermission>();

            CreateMap<CreateRoleDto, Role>();
            CreateMap<UpdateRoleDto, Role>();


            //CreateMap<Role, RoleDto>()
            //.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name));
        }
    }
}
